package cn.tannn.ops.nginx.entity;

import cn.tannn.ops.common.constant.CloudEnums;
import cn.tannn.ops.common.pojo.JpaCommonBean;
import cn.tannn.ops.nginx.entity.converter.CloudEnumsConverter;
import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * 云厂商的AccessKey
 *
 * @author <a href="https://t.tannn.cn/">tan</a>
 * @version V1.0
 * @date 2024/8/28 下午3:49
 */
@Entity
@Table(name = "nginx_cloud_access_key")
@Comment("云厂商的AccessKey")
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@DynamicUpdate
@DynamicInsert
public class CloudAccessKey extends JpaCommonBean<CloudAccessKey> {

    /**
     * 当前数据的名字[其他地方显示用的]
     */
    @Comment("当前数据的名字[其他地方显示用的]")
    @Column(columnDefinition = "varchar(100) not null")
    String name;

    /**
     * 云厂商账号
     */
    @Comment("云厂商账号")
    @Column(columnDefinition = "varchar(100) not null")
    String account;

    /**
     * 云厂商账号的ID
     */
    @Comment("云厂商账号的ID")
    @Column(columnDefinition = "varchar(100) not null")
    String accessId;

    /**
     * 云厂商账号的 Secret
     */
    @Comment("云厂商账号的 Secret")
    @Column(columnDefinition = "varchar(100) not null")
    String accessSecret;

    /**
     * 云厂商名字 - 固定几个
     * @see CloudEnums
     */
    @Comment("云厂商名字")
    @Column(columnDefinition = "varchar(50) not null")
    @Convert(converter = CloudEnumsConverter.class)
    CloudEnums cloud;


    @Comment("备注")
    @Column(columnDefinition = "varchar(100)")
    String remark;
}
